package report_log

import (
	"fmt"
	"log"
	"os"
)

func getLogger(fileName string) *log.Logger {
	path := "../../tmp/log/" + fileName + ".log"
	file, err := os.OpenFile(path, os.O_CREATE|os.O_RDWR|os.O_APPEND, os.ModeAppend|os.ModePerm)
	if err != nil {
		fmt.Println("创建失败:" + err.Error())
	}

	logger := log.New(file, "", log.LstdFlags)
	logger.SetFlags(log.LstdFlags)
	return logger
}
